<?php

/**
 * Tabela do texto inicial.
 *
 * @author Fernando Dias Oliveira <rodox17@gmail.com>
 * @package lore
 * @subpackage model
 */

class caf03 extends Zend_Db_Table_Abstract  
{
	protected $_table   = "caf03";
	protected $_primary = "caf03_cod";
	
	public function getArray()
	{
		$arr = array();
		
		foreach ($this->fetchAll()->toArray() as $val)
		{
			$arr[$val["caf03_cod"]] = $val["caf03_menu"];
		}
		
		return $arr;
	}
	
	public function getAll($page, $limit = 10)
	{
		// $sql = $this->select()->where("caf03_status = 1")->limit(3, 0);
		$sql = $this->select()->where("caf03_status = 1");
		
		return $this->fetchAll($sql)->toArray();
	}
	
	public function getDropDrow()
	{
		$arr   = array();
		
		$arr[""] = "Selecione";
		
		foreach ($this->fetchAll("caf03_status = 1") as $val)
		{
			$arr[$val["caf03_cod"]] = $val["caf03_menu"];
		}
		
		return $arr;
	}
	
	public function save($arrPost)
	{
		$this->insert($arrPost);
	}
}

?>
